<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" href="css/form.css" />
</head>

<body>
	<div id="header-wrap" data-mn=0 data-limit=2>
		<a href="###" data-link="safe" data-type="ico" class="left ico-m ico-left"></a>
		<h2>银行卡管理</h2>
		<a href="###" data-type="ico" id="jb" class="right ico-m ico-pr ico-red ico-subtract">解绑</a>
	</div>
	
	<div id="bank-card">
		<div class="card-wrap">
			<span class="bico-gongshangyinhang" ></span>
			<h3 id="">中国工商银行借记卡</h3>
			<b id="card_code"></b>
			<em id="card_name"></em>
		</div>
		<div class="feed-info">
			<h2>关于银行卡</h2>
			每个用户同时只能绑定一张银行卡；<br />
			必须是借记卡，不能绑贷记卡（信用卡）；<br />
			解除绑定（更换银行卡）的功能尚不确定在正式版实现；<br />
			如果正式版不开通此功能，用户绑定卡后需要更换时需要一些线下流程。<br /><br />
			<h2>如有疑问请咨询</h2>
			客服电话：400-105-8851<br />
			微信客服：wuyifugui(公众号)
		</div>
	</div>
	<form id="unbind">
	<div class="tips">
		<div class="t-info">为了您的资金安全，充值、提现之前需要绑定银行卡<br />资金仅进出该卡</div>
		<div class="t-error"></div>
	</div>
	<ul class="form-list">
		<li class="ico-m ico-pl ico-card" data-type="ico">
			<div class="fl-cont form-input f-right-btn">
				<input type="number" id="card_number" placeholder="请输入银行卡号" value="6222600620011234" />
				<span class="right" id="bank_name" style="display: none;">工商银行</span>
			</div>
		</li>
		<li class="ico-m ico-pl ico-change" data-type="ico">
			<div class="fl-cont form-input">
				手续费：<span id="shouxufei"></span>元
			</div>
		</li>
	</ul>
	<div class="" >
		<h3 style="padding: 10px;text-align: center;">银行预留信息必须与实名认证信息一致</h3>
		<ul class="label-list c-right">
			<li class="">
				<label>姓名</label>
				<div class="ll-cont"><span id="id_name"></span></div>
			</li>
			<li class="">
				<label>身份证</label>
				<div class="ll-cont"><span id="id_code"></span></div>
			</li>
		</ul>
	</div>
	<div class="fixed-btn">
		<a href="first-pay.html" class="btn b-red"><span id="check">下一步</span></a>
	</div>
	<div class="feed-info">
		<h2>免费绑卡！</h2>
		绑定银行卡需要2.00元手续费，该费用在您绑卡成功后，将返还至您的账户余额！<br /><br />
		<h2>正式版环境</h2>
		输入银行卡号前6位后，即可根据BIN码自动识别所属银行；<br />
		由于数据繁杂，不便在静态版本模拟该效果，所以DEMO版的所属银行统一为“工商银行”。<br /><br />
		客服电话：400-105-8851<br />
		微信客服：wuyifugui(公众号)
	</div>
	</form>
	
	<script>
	$(function(){
		$.cookie("recharge_temp",2)
		var name = $.cookie("name_show")
		var id = $.cookie("id_show")
		var bc_show = $.cookie("bc_show")
		var bank_card = $.cookie("bcard");
		var shouxufei = Number($.cookie("recharge_temp")).toFixed(2);
		$("#shouxufei").text(shouxufei)
		if(bank_card !== undefined){
			$("#unbind").remove();
			$("#card_code").text(bc_show)
			$("#card_name").text(name)
			$("#jb").on("click",function(){
				var clear = confirm("要将"+bc_show+"银行卡解除绑定吗？");
				if (clear == true){
					$.cookie("bc_show","",{expires: -1})
					$.cookie("bc_show_2","",{expires: -1})
					$.cookie("bcard","",{expires: -1})
					$.cookie("cb_temp","",{expires: -1})
					load_page("edit-bcard")
				}else{
					return false
				}
			})
		}else{
			$("#bank-card,#jb").remove();
			$("#id_code").text(id);
			$("#id_name").text(name);
			$("#card_number").on("keyup",function(){
				var len = $(this).val().length;
				if(len > 5 && len <20){
					$("#bank_name").fadeIn(200)
				}else{
					$("#bank_name").hide()
				}
			})
			$("#check").on("click",function(){
				var card_number = $("#card_number").check({type:4});
				if(card_number == 0){
					$(".t-error").text("请输入有效银行卡号").fadeIn(100)
					$(".t-info").hide();
					reset_tip()
					return false
				}else{
					var card_code = $("#card_number").val()
					$.cookie("cb_temp",card_code);
				}
			})
		}
		
	})
	</script>	
</body>

</html>
